package com.aa.service.impl;

import com.aa.dao.OrderdetailDao;
import com.aa.entity.Orderdetail;
import com.aa.entity.Orders;
import com.aa.service.OrderdetailService;
import com.aa.service.OrdersService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class OrderdetailServiceImpl implements OrderdetailService {
    @Resource
    OrderdetailDao orderdetailDao;

    @Override
    public PageInfo<Orderdetail> queryAll(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Orderdetail> list=orderdetailDao.queryAll();
        PageInfo<Orderdetail> pageInfo = new PageInfo<>(list);
        return pageInfo;

    }

    @Override
    public int deleteByID(Integer id) {
        return orderdetailDao.deleteByID(id);
    }

    @Override
    public ArrayList<Orderdetail> query(Integer oid) {
        return orderdetailDao.query(oid);
    }

    @Override
    public Orderdetail findById(Integer id) {
        return orderdetailDao.findById(id);
    }


}
